#include <iostream>
#include <unistd.h>
#include <signal.h>
#include<error.h>
#include<cstring>
using namespace std;

// mykill -9 pid
int main(int argc, char *argv[])
{
    if (argc != 3)
    {
        cout << " usage error: " << argv[0] << " -signumber pid" << endl;
    }

    pid_t pid = stoi(argv[2]);
    int sig = stoi(argv[1]+1);
    int n = kill(pid, sig);

    if (n < 0)
    {
        cerr << "kill error, " << strerror(errno) << endl;
    }

    return 0;
}